from ronglian_sms_sdk import SmsSDK
from celery_tasks.main import app

accId = '8a216da881ad9754018219bdebae19d9'
accToken = '47468758c17e46a9973732e824daaafe'
appId = '8a216da881ad9754018219bdecd019e0'

@app.task(name="send_sms_code")
def send_sms_code(phone,data):
    sdk = SmsSDK(accId, accToken, appId)
    # 短信的模板
    tid = '1'
    mobile = phone
    datas = (data,)
    resp = sdk.sendMessage(tid, mobile, datas)
    return resp
